<?php
/*********************************************
  CPG Dragonfly™ CMS
  ********************************************
  Copyright © 2004 - 2007 by CPG-Nuke Dev Team
  http://dragonflycms.org

  Dragonfly is released under the terms and conditions
  of the GNU GPL version 2 or any later version
**********************************************/
if (!defined('INSTALL')) { exit; }

function synch_modules(array $modules=array())
{
	echo '<h3>Installing included modules:</h3>';
	foreach ($modules as $module) {
		echo $module;
		if ($installer = new Installer_Module($module, true)) {
			if ($installer->add_module()) {
				echo ' installed.<br />';
				continue;
			}
		}
		echo '\'s install failed';
		echo ": {$installer->error}";
		echo '.<br />';
		libxml_clear_errors();
	}
}

$installer->add_query('INSERT', 'message', "1, 'Welcome to Dragonfly!', '[align=center]Thanks for downloading Dragonfly ".CPG_NUKE.". We hope you enjoy your new website!\r\n\r\nThis message can be removed easily through the [url={$adminindex}]administration menu[/url].[/align]', ".time().", 0, 1, 0, ''");

$installer->add_query('UPDATE', 'config_custom', "cfg_value='".date('F j, Y')."' WHERE cfg_name='global' AND cfg_field='startdate'");
$installer->add_query('UPDATE', 'cpg_installs', "prefix=REPLACE(prefix,'\$prefix.','{$prefix}')");
$installer->add_query('UPDATE', 'modules_cat', "link='{$mainindex}' WHERE name='_HOME'");
